/**
 * Created by windo on 2016/11/22.
 */
let func1=function(a){
    return a+1;
}
let func2=(a) =>{
    return a+1;
}
let res1=func1(1);
let res2=func2(2);
//console.log(res1,res2)

let arr=[1,3,5,7];
let r=arr.map(function(item,index,arr){
    return item*item;
})
let r1=arr.map(item=>{
    return item*item;
})
let r2=arr.map((item,index,arr)=>item*item)
let r3=arr.map(item=>item*item)
console.log(r)
console.log(r1)
console.log(r2)
console.log(r3)
//箭头函数中this不变
function funcThis(){
    setTimeout(function() {
        debugger;
        console.log(this.id);
    })
  /*  setTimeout(()=>{
        console.log(this.id)
    })*/
}
let obj={
    id:123
}
funcThis.call(obj);